<?php

namespace seecms\wechat\config;

use seecms\See;

class WechatConfig
{
    /**
     * 微信公众号素材设置
     * @return array|mixed
     */
    public static function material()
    {
        $config = See::config()->value('wechat');

        return $config['material'] ?? [];
    }

    /**
     * 微信公众号素材保存路径
     * @return string
     */
    public static function materialRoot(): string
    {
        $root = self::material()['root'] ?? '';

        return trim(trim($root, '/'), '\\');
    }

    /**
     * 保存路径对应的外部URL路径
     * @return string
     */
    public static function materialUrl(): string
    {
        $url = self::material()['url'] ?? '';

        return trim(trim($url, '/'), '\\');
    }

    /**
     * @return string
     */
    public static function log(): string
    {
        $config = See::config()->value('wechat');

        return $config['log'] ?? '';
    }
}